﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Collections.ObjectModel;
using System.Xml.Linq;
using System.Windows;
using System.Reflection;
using System.IO;
using System.ComponentModel;
using Microsoft.Win32;
using System.Data;
using System.Collections;
using System.Windows.Media;
using InteControlSys.SampleService;
using DiagramShop.Ctrl;

namespace InteControlSys.ViewModel
{
    public class SampleManageControlViewModel:INPCBase
    {
        //菜单列表
        private TreeSampleViewModel treeSampleVM;

        public TreeSampleViewModel TreeSampleVM
        {
            get { return treeSampleVM; }
            set
            {
                treeSampleVM = value;
                NotifyChanged("TreeSampleVM");

            }
        }

        private NodeViewModel currentSelectedObject;//当前选中对象
        public NodeViewModel CurrentSelectedObject
        {
            get { return currentSelectedObject; }
            set
            {
                currentSelectedObject = value;
                NotifyChanged("CurrentSelectedObject");
            }
        }

     
        public SampleManageControlViewModel()
        {
            Init();
        }
        private void Init()
        {
            TreeSampleViewModel vm = new TreeSampleViewModel(this);

            NodeViewModel newItem = new AnalysGroupBriefViewModel("取样管理");
            vm.RootChildren.Add(newItem);
            vm.Items.Add(newItem);
            NodeViewModel item  = new AnalysGroupBriefViewModel("组批取样跟踪");
            newItem.Children.Add(item);
            this.TreeSampleVM = vm;
            newItem = new BucketTransViewModel("大样交接管理");
            vm.RootChildren.Add(newItem);
            vm.Items.Add(newItem);
            item = new BucketTransViewModel("样桶输送");
            newItem.Children.Add(item);
            item = new SampleAlarmViewModel("大样异常");
            newItem.Children.Add(item);
            item = new SampleRecordsViewModel("大样记录查询");
            newItem.Children.Add(item);
            this.TreeSampleVM = vm;
            newItem = new SampleMadeViewModel("精制样管理");
            vm.RootChildren.Add(newItem);
            vm.Items.Add(newItem);
            item = new SampleMadeViewModel("制样记录查询");
            newItem.Children.Add(item);
            item = new SampleSaveViewModel("存样记录查询");
            newItem.Children.Add(item);
            item = new DeliverBoxViewModel("送样箱管理");
            newItem.Children.Add(item);

            this.TreeSampleVM = vm;            
        }      

    }
}
